{% extends "base.html" %}
{% load match %}

{% block additional_title %}
Današnji mečevi
{% endblock %}

{% block content %}

<center>
	<h2>Poslednji mečevi &mdash; {{ game_name }}</h2>
	{% if matches %}
	<table class="tablesorter" id="mainTable">
	    <thead>
	        <th>Meč</th>
	        <th>Rezultat</th>
	       	<th>Datum igranja</th>
			{% if perms.mdcsapp.delete_match %}
	    	<th>Akcije</th>
	    	{% endif %}
	    </thead>
	    <tbody>
	        {% for match in matches %}
	        <tr>
	            <td>{{ match|match }} </td>
	            <td>
	            {% if match.game_type == 1 and match.result == "0:0" %}
	            ½ : ½
	            {% else %} 
	            {{ match.result }}
	            {% endif %}
	            </td>
	            <td>{{ match.date_played|date }} {{ match.date_played|time }}</td>
	            {% if perms.mdcsapp.delete_match %}
	    		<td><a href="/mdcs/match/undo/{{ match.id }}/">Poništi meč</a></td>
	    		{% endif %}
	        </tr>
	        {% endfor %}
	    </tbody>
	</table>
	{% else %}
	Nema odigranih mečeva!
	{% endif %}
</center>
{% endblock %}